package com.itheima.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@TableName("dept") //用于实体类的名称和数据库不一致的时候
@NoArgsConstructor
@AllArgsConstructor
public class Dept {
    @TableId(value = "id",type= IdType.AUTO)
    private Integer id;
    @TableField("dept_name") //用于映射字段名称和实体类名称不一致的时候
    private String name;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    @TableField(exist = false) //mybatis plus用于数据库没有这个字段的映射
    private Integer count;
}
